//index.js
//获取应用实例
var urlss = 'https://api.douban.com/v2/movie/top250';
var app = getApp();
Page({
  data: {
    title: '加载中',
    movies:[]
  },
  onLoad: function () {

    var that = this;
    wx.showToast({
      title: '加载中....',
      icon: 'loading',
      duration: 10000
    }),
      wx.request({
        url: "https://api.douban.com/v2/movie/top250",
        data: {},
        method:"GET",
        header: {
          "Content-Type": "json"
        },
        success: function (res) {
          console.log(res.data);
          wx.hideToast();
          that.setData({
            title:res.data.title,
            movies:res.data.subjects
          })
        }
       
      })
  }
})
